home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / catn / array.n < prev    next >
Text File  |  1994-09-20  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4. array(n)              Tcl Built-In Commands
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      array - Manipulate array variables
  12.  
  13. SYNOPSIS
  14.      array _o_p_t_i_o_n _a_r_r_a_y_N_a_m_e ?_a_r_g _a_r_g ...?
  15. _________________________________________________________________
  16.  
  17.  
  18. DESCRIPTION
  19.      This command performs one of several operations on the vari-
  20.      able  given  by _a_r_r_a_y_N_a_m_e.  _A_r_r_a_y_N_a_m_e must be the name of an
  21.      existing array variable.   The  _o_p_t_i_o_n  argument  determines
  22.      what  action  is  carried  out  by  the  command.  The legal
  23.      _o_p_t_i_o_n_s (which may be abbreviated) are:
  24.  
  25.      array anymore _a_r_r_a_y_N_a_m_e _s_e_a_r_c_h_I_d
  26.           Returns 1 if there are any more  elements  left  to  be
  27.           processed  in  an  array search, 0 if all elements have
  28.           already been returned.  _S_e_a_r_c_h_I_d indicates which search
  29.           on  _a_r_r_a_y_N_a_m_e  to  check, and must have been the return
  30.           value from a previous invocation of array  startsearch.
  31.           This  option  is particularly useful if an array has an
  32.           element with an empty name, since the return value from
  33.           array nextelement won't indicate whether the search has
  34.           been completed.
  35.  
  36.      array donesearch _a_r_r_a_y_N_a_m_e _s_e_a_r_c_h_I_d
  37.           This command terminates an array  search  and  destroys
  38.           all  the  state  associated with that search.  _S_e_a_r_c_h_I_d
  39.           indicates which search on  _a_r_r_a_y_N_a_m_e  to  destroy,  and
  40.           must have been the return value from a previous invoca-
  41.           tion of array startsearch.  Returns an empty string.
  42.  
  43.      array names _a_r_r_a_y_N_a_m_e
  44.           Returns a list containing the names of all of the  ele-
  45.           ments  in  the  array.  If there are no elements in the
  46.           array then an empty string is returned.
  47.  
  48.      array nextelement _a_r_r_a_y_N_a_m_e _s_e_a_r_c_h_I_d
  49.           Returns the name of the next element in  _a_r_r_a_y_N_a_m_e,  or
  50.           an  empty  string  if  all  elements  of _a_r_r_a_y_N_a_m_e have
  51.           already been returned in  this  search.   The  _s_e_a_r_c_h_I_d
  52.           argument  identifies the search, and must have been the
  53.           return value of an array startsearch command.  Warning:
  54.           if  elements  are  added  to or deleted from the array,
  55.           then all searches are automatically terminated just  as
  56.           if  array  donesearch had been invoked; this will cause
  57.           array  nextelement  operations  to   fail   for   those
  58.           searches.
  59.  
  60.  
  61.  
  62.  
  63. Tcl                                                             1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. array(n)              Tcl Built-In Commands
  71.  
  72.  
  73.  
  74.      array size _a_r_r_a_y_N_a_m_e
  75.           Returns a decimal string giving the number of  elements
  76.           in the array.
  77.  
  78.      array startsearch _a_r_r_a_y_N_a_m_e
  79.           This command initializes an  element-by-element  search
  80.           through the array given by _a_r_r_a_y_N_a_m_e, such that invoca-
  81.           tions of the array nextelement command will return  the
  82.           names  of  the  individual elements in the array.  When
  83.           the search has been  completed,  the  array  donesearch
  84.           command  should  be  invoked.   The  return  value is a
  85.           search identifier that must be used in  array  nextele-
  86.           ment  and array donesearch commands; it allows multiple
  87.           searches to be underway  simultaneously  for  the  same
  88.           array.
  89.  
  90.  
  91. KEYWORDS
  92.      array, element names, search
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Tcl                                                             2
  130.  
  131.  
  132.  
  133.